package com.eastfair.venuebooking.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 销售线索表
 * </p>
 *
 * @author dqq
 * @since 2023-04-03
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("vb_sale_clue")
@ApiModel(value = "SaleClue", description = "销售线索表")
@AllArgsConstructor
public class SaleClue extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 归属人员
     */
    @ApiModelProperty(value = "归属人员")
    @TableField(value = "belong_to")
    @Excel(name = "归属人员")
    private Long belongTo;

    /**
     * 归属人姓名
     */
    @ApiModelProperty(value = "归属人姓名")
    @Size(max = 255, message = "归属人姓名长度不能超过255")
    @TableField(value = "belong_to_name", condition = LIKE)
    @Excel(name = "归属人姓名")
    private String belongToName;

    /**
     * 归属人员部门id
     */
    @ApiModelProperty(value = "归属人员部门id")
    @TableField(value = "org_code")
    @Excel(name = "归属人员部门id")
    private Long orgCode;

    /**
     * 归属部门
     */
    @ApiModelProperty(value = "归属部门")
    @Size(max = 64, message = "归属部门长度不能超过64")
    @TableField(value = "org_name", condition = LIKE)
    @Excel(name = "归属部门")
    private String orgName;

    /**
     * 前归属部门ID
     */
    @ApiModelProperty(value = "前归属部门ID")
    @TableField(value = "last_org_code")
    @Excel(name = "前归属部门ID")
    private Long lastOrgCode;

    /**
     * 前归属部门名称
     */
    @ApiModelProperty(value = "前归属部门名称")
    @Size(max = 64, message = "前归属部门名称长度不能超过64")
    @TableField(value = "last_org_name", condition = LIKE)
    @Excel(name = "前归属部门名称")
    private String lastOrgName;

    /**
     * 线索标题
     */
    @ApiModelProperty(value = "线索标题")
    @Size(max = 75, message = "线索标题长度不能超过75")
    @TableField(value = "clue_title", condition = LIKE)
    @Excel(name = "线索标题")
    private String clueTitle;

    /**
     * 线索来源，同名数据字典
     */
    @ApiModelProperty(value = "线索来源，同名数据字典")
    @Size(max = 64, message = "线索来源，同名数据字典长度不能超过64")
    @TableField(value = "clue_source", condition = LIKE)
    @Excel(name = "线索来源，同名数据字典")
    private String clueSource;

    /**
     * 线索状态(同名数据字典)
     */
    @ApiModelProperty(value = "线索状态(同名数据字典)")
    @Size(max = 64, message = "线索状态(同名数据字典)长度不能超过64")
    @TableField(value = "clue_status", condition = LIKE)
    @Excel(name = "线索状态(同名数据字典)")
    private String clueStatus;

    /**
     * 前归属人
     */
    @ApiModelProperty(value = "前归属人")
    @TableField(value = "last_belong_to")
    @Excel(name = "前归属人")
    private Long lastBelongTo;

    /**
     * 前归属人姓名
     */
    @ApiModelProperty(value = "前归属人姓名")
    @Size(max = 255, message = "前归属人姓名长度不能超过255")
    @TableField(value = "last_belong_to_name", condition = LIKE)
    @Excel(name = "前归属人姓名")
    private String lastBelongToName;

    /**
     * 部门id
     */
    @ApiModelProperty(value = "部门id")
    @TableField(value = "dept_id")
    @Excel(name = "部门id")
    private Long deptId;

    /**
     * 客户id
     */
    @ApiModelProperty(value = "客户id")
    @TableField(value = "customer_id")
    @Excel(name = "客户id")
    private Long customerId;

    /**
     * 客户名称
     */
    @ApiModelProperty(value = "客户名称")
    @Size(max = 64, message = "客户名称长度不能超过64")
    @TableField(value = "customer_name", condition = LIKE)
    @Excel(name = "客户名称")
    private String customerName;

    /**
     * 联系人id
     */
    @ApiModelProperty(value = "联系人id")
    @TableField(value = "contact_id")
    @Excel(name = "联系人id")
    private Long contactId;

    /**
     * 联系人姓名
     */
    @ApiModelProperty(value = "联系人姓名")
    @Size(max = 20, message = "联系人姓名长度不能超过20")
    @TableField(value = "contact_name", condition = LIKE)
    @Excel(name = "联系人姓名")
    private String contactName;

    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition")
    @Excel(name = "展会id")
    private Long exhibition;

    /**
     * 展会名称
     */
    @ApiModelProperty(value = "展会名称")
    @Size(max = 255, message = "展会名称长度不能超过255")
    @TableField(value = "exhibition_name", condition = LIKE)
    @Excel(name = "展会名称")
    private String exhibitionName;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Size(max = 1000, message = "备注长度不能超过1000")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "备注")
    private String remark;

    /**
     * 最后跟进时间
     */
    @ApiModelProperty(value = "最后跟进时间")
    @TableField(value = "last_follow_date")
    @Excel(name = "最后跟进时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime lastFollowDate;

    /**
     * 下次跟进时间
     */
    @ApiModelProperty(value = "下次跟进时间")
    @TableField(value = "next_follow_date")
    @Excel(name = "下次跟进时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime nextFollowDate;

    /**
     * 数据状态(0正常 1公共)
     */
    @ApiModelProperty(value = "数据状态(0正常 1公共)")
    @TableField(value = "state")
    @Excel(name = "数据状态(0正常 1公共)")
    private Integer state;

    /**
     * 客户举办类型 (SPONSOR:主办;UNDERTAKE:承办)
     */
    @ApiModelProperty(value = "客户举办类型 (SPONSOR:主办;UNDERTAKE:承办)")
    @Size(max = 64, message = "客户举办类型 (SPONSOR:主办;UNDERTAKE:承办)长度不能超过64")
    @TableField(value = "customer_identity", condition = LIKE)
    @Excel(name = "客户举办类型 (SPONSOR:主办;UNDERTAKE:承办)")
    private String customerIdentity;


    @Builder
    public SaleClue(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    Long belongTo, String belongToName, Long orgCode, String orgName, Long lastOrgCode, String lastOrgName, 
                    String clueTitle, String clueSource, String clueStatus, Long lastBelongTo, String lastBelongToName, Long deptId, 
                    Long customerId, String customerName, Long contactId, String contactName, Long exhibition, String exhibitionName, 
                    String remark, LocalDateTime lastFollowDate, LocalDateTime nextFollowDate, Integer state, String customerIdentity) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.belongTo = belongTo;
        this.belongToName = belongToName;
        this.orgCode = orgCode;
        this.orgName = orgName;
        this.lastOrgCode = lastOrgCode;
        this.lastOrgName = lastOrgName;
        this.clueTitle = clueTitle;
        this.clueSource = clueSource;
        this.clueStatus = clueStatus;
        this.lastBelongTo = lastBelongTo;
        this.lastBelongToName = lastBelongToName;
        this.deptId = deptId;
        this.customerId = customerId;
        this.customerName = customerName;
        this.contactId = contactId;
        this.contactName = contactName;
        this.exhibition = exhibition;
        this.exhibitionName = exhibitionName;
        this.remark = remark;
        this.lastFollowDate = lastFollowDate;
        this.nextFollowDate = nextFollowDate;
        this.state = state;
        this.customerIdentity = customerIdentity;
    }

}
